package com.dragon.pear.pages.tabs.main.sample;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView;

import com.chris.libs.base.x.mvpp.recycler.BaseRecyclerHolder;
import com.chris.libs.base.x.mvpp.viewholder.BaseViewHolder;
import com.dragon.pear.R;
import com.dragon.pear.models.mock.MockUserItemResult;

import javax.inject.Inject;

import butterknife.BindView;

/**
 * @author Chris Chan
 * Create on: 2025-09-10 21:34
 * Use for: Sample 界面元素持有者
 * Explain:
 */
public class SampleViewHolders {
    /**
     * 主界面 ViewHolder
     */
    public static class MainViewHolder extends BaseViewHolder {
        @BindView(R.id.rv_mock)
        public RecyclerView rvMock;

        @Inject
        public MainViewHolder() {
        }
    }

    /**
     * ItemMockData ViewHolder
     */
    public static class ItemMockDataRvViewHolder extends BaseRecyclerHolder<MockUserItemResult> {
        @BindView(R.id.tv_username)
        TextView tvUsername;
        @BindView(R.id.tv_phone)
        TextView tvPhone;
        @BindView(R.id.tv_email)
        TextView tvEmail;

        public ItemMockDataRvViewHolder(Context context, View itemView) {
            super(context, itemView);
        }

        @Override
        public void refreshView(MockUserItemResult item) {
            tvUsername.setText(item.getUsername());
            tvPhone.setText(item.getPhone());
            tvEmail.setText(item.getEmail());
        }
    }


}
